<?php

namespace CMBUBank\UBank\Request\TransManager;

use CMBUBank\UBank\Request\UBankBaseRequest;
use CMBUBank\UBank\Response\TransManager\TransManagerSubunitInterTransferResponse;

class TransManagerSubunitInterTransferRequest extends UBankBaseRequest
{
    protected $code = 'NTDMITRX';

    protected $response = TransManagerSubunitInterTransferResponse::class;

    protected $logTip = '记账子单元内部转账';

    private $busMode;

    private $backNo;

    private $account;

    private $outSubCode;

    private $inSubCode;

    private $money;

    private $remark;

    public function generate(): array
    {
        return [
            'ntbusmody' => [[
                'busmod' => $this->busMode
            ]],
            'ntdmitrxx1' => [[
                'bbknbr' => $this->backNo,
                'accnbr' => $this->account,
                'dmadbt' => $this->outSubCode,
                'dmacrt' => $this->inSubCode,
                'trsamt' => $this->money,
                'trstxt' => $this->remark,
                'yurref' => $this->newReqCode()
            ]],
        ];
    }

    public function setBusMode($busMode): void
    {
        $this->busMode = $busMode;
    }

    public function setBackNo($backNo): void
    {
        $this->backNo = $backNo;
    }

    public function setAccount($account): void
    {
        $this->account = $account;
    }

    public function setOutSubCode($outSubCode): void
    {
        $this->outSubCode = $outSubCode;
    }

    public function setInSubCode($inSubCode): void
    {
        $this->inSubCode = $inSubCode;
    }

    public function setMoney($money): void
    {
        $this->money = $money;
    }

    public function setRemark($remark): void
    {
        $this->remark = $remark;
    }
}